<%
# Copyright (C) 2011 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
%>

<% add_crumb t('#crumbs.confirmation', "Confirmation") %>
<% content_for :page_title, t('titles.confirm', 'Confirm Action') %>

<div style="margin: 10px auto; width: 600px;">
  <% if params[:event] == "delete" %>
    <h1>{{#t}}Confirm Course Deletion{{/t}}</h1>
    <%= t 'details.confirm_delete', %{Are you sure you want to delete this course? Once it is deleted, students and teachers will no longer have access to it. If you just want to remove it from the course drop-down menu, you should *conclude the course instead*.}, :wrapper => link_to('\1', context_url(@context, :context_confirm_action_url, :event => 'conclude')) %>
    <%= t 'details.confirm_delete_addendum', %{If you do not have permission to conclude the course, you can *change the course end date*, or ask your administrator to conclude the course. }, :wrapper => link_to('\1', course_settings_url(@context)) %>
    <%= form_tag context_url(@context, :context_url), {:method => :delete} do %>
      <input type="hidden" name="event" value="delete"/>
      <div class="form-actions">
        <a href="<%= course_settings_url(@context) %>" class="btn">{{#t}}Cancel{{/t}}</a>
        <button class="btn btn-danger" type="submit">{{#t}}Delete Course{{/t}}</button>
      </div>
    <% end %>
  <% else %>
    <h1>{{#t}}Confirm Conclude Course{{/t}}</h1>
    <p><%= t 'details.confirm_conclude', %{Warning: Concluding the course will archive all course content and prevent you from modifying grades.} %></p>
    <p><%= t 'details.conclude_alt_text', %{If you would like to retain the ability to change grades while limiting student access to the course, please utilize the course dates settings. You can learn about course date settings in our guides *here*.}, :wrapper => link_to('\1', "https://community.canvaslms.com/docs/DOC-2910") %></p>

    <%= form_tag context_url(@context, :context_url), {:method => :delete} do %>
      <input type="hidden" name="event" value="conclude"/>
      <div class="form-actions">
        <a href="<%= course_settings_url(@context) %>" class="btn">{{#t}}Cancel{{/t}}</a>
        <button class="btn btn-primary" type="submit">{{#t}}Conclude Course{{/t}}</button>
      </div>
    <% end %>

  <% end %>
</div>
